
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require("extract-text-webpack-plugin");

const isContext = process.env.NODE_ENV === 'work'

module.exports = {
	output:{
		path: path.resolve(__dirname, '../webBloger'),
		publicPath: '/webBlog/',
		filename:'[name].[chunkhash].js'
	},
	module:{
		rules:[{
			test:/\.css$/,use:ExtractTextPlugin.extract({
				fallback:'style-loader',
				use:'css-loader'
			})
		},{
			test:/\.(png|jpg|jeg|gif|svg)$/,
			use:['url-loader?limit=100&name=image/[name].[ext]']
		},{
			test:/\.js$/,
			exclude:/node_modules/,
			loader:'babel-loader'
		},{
			test:/\.vue$/,
			use:'vue-loader'
		}]
	},
	resolve:{
		extensions: ['.vue','.js','.json'],
		alias:{
			"app": path.resolve(__dirname,'../app'),
			"components": path.resolve(__dirname, '../app/components'),
			"store": path.resolve(__dirname, '../app/store'),
			"assets": path.resolve(__dirname, '../app/assets'),
			"config": path.resolve(__dirname, '../app/config')
		}
	}
}